﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 第11章Linq
{
    class Program
    {
        static void Main(string[] args)
        {
                    
            //1.获取数据源
            var nums = new int[7] { 0, 1, 2, 3, 4, 5, 6 };

            //2.创建查询
            var numQuery =
                from num in nums
                where (num % 2) == 0
                select num;

            //3.执行查询
            foreach (var num in numQuery)
            {
                Console.WriteLine("{0}", num);
            }
            
        }
    }
}
